package map;

import hash.hashcode.CandyHashTable;

public class CandyHashMap<K, V> implements CandyMap<K, V> {
    private CandyHashTable<K, V> hashTable;
    
    public CandyHashMap() {
        hashTable = new CandyHashTable<>();
    }
    
    public CandyHashMap(int M) {
        hashTable = new CandyHashTable<>(M);
    }

    @Override
    public void add(K key, V value) {
        hashTable.add(key, value);
    }

    @Override
    public V remove(K key) {
        return hashTable.remove(key);
    }

    @Override
    public boolean contains(K key) {
        return hashTable.contains(key);
    }

    @Override
    public V get(K key) {
        return hashTable.get(key);
    }

    @Override
    public void set(K key, V newValue) {
        hashTable.set(key, newValue);
    }

    @Override
    public int getSize() {
        return hashTable.getSize();
    }

    @Override
    public boolean isEmpty() {
        return hashTable.isEmpty();
    }

}
